package com.bustle.user.dto.authentication;

import javax.ejb.EJB;
import javax.ejb.Local;
import javax.ejb.Stateless;

import com.bustle.commons.MapConverter;
import com.bustle.commons.data.dao.Dao;
import com.bustle.commons.data.dto.DtoDao;
import com.bustle.user.data.Authentication;
import com.bustle.user.data.dao.AuthenticationDao;

@Local
public interface AuthenticationDtoDao extends Dao<String, AuthenticationDto>
{
  @Stateless
  public class DefaultAuthenticationDtoDao extends DtoDao<String, AuthenticationDto, Authentication> implements AuthenticationDtoDao
  {
    @Override
    protected Dao<String, Authentication> getDao()
    {
      return authenticationDao;
    }

    @Override
    protected MapConverter<AuthenticationDto, Authentication> getDtoToDataMapConverter()
    {
      return dtoToAuthenticationConverter;
    }

    @Override
    protected MapConverter<Authentication, AuthenticationDto> getDataToDtoMapConverter()
    {
      return authenticationToDtoConverter;
    }

    @EJB
    protected AuthenticationDao authenticationDao;
    @EJB
    protected DtoToAuthenticationMapConverter dtoToAuthenticationConverter;
    @EJB
    protected AuthenticationToDtoMapConverter authenticationToDtoConverter;
  }
}
